home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-23 | 1.9 KB | 74 lines | [TEXT/PJMM] |
- { Initialize.p functions related to starting up the program }
- { translated from Programming for System 7 }
- unit MyAppleEvent;
- interface
- uses
- AppleEvents, Globals;
- function HandleODoc (theAppleEvent: AppleEvent;
- reply: AppleEvent;
- myRefCon: LONGINT): OSErr;
- function HandleQuit (theAppleEvent: AppleEvent;
- reply: AppleEvent;
- myRefCon: LONGINT): OSErr;
-
- function HandlePDOC (theAppleEvent: AppleEvent;
- reply: AppleEvent;
- myRefCon: LONGINT): OSErr;
- function HandleOApp (theAppleEvent: AppleEvent;
- reply: AppleEvent;
- myRefCon: LONGINT): OSErr;
- implementation
- uses
- Globals;
- function RequiredCheck (theAppleEvent: AppleEvent): OSErr;
- var
- myErr: OSErr;
- typeCode: DescType;
- actualSize: Size;
- sourceOfAE: integer;
- begin
- sourceOfAE := 0;
- myErr := AEGetAttributePtr(theAppleEvent, keyMissedKeywordAttr, typeWildCard, typeCode, nil, 0, actualSize);
- RequiredCheck := myErr;
- if myErr = errAEDescNotFound then
- begin
- RequiredCheck := noErr;
- end
- else if myErr = noErr then
- begin
- RequiredCheck := errAEEventNotHandled;
- end;
- end;
- function HandleOApp (theAppleEvent: AppleEvent;
- reply: AppleEvent;
- myRefCon: LONGINT): OSErr;
-
- begin
- HandleOApp := RequiredCheck(theAppleEvent);
- end;
- function HandlePDOC (theAppleEvent: AppleEvent;
- reply: AppleEvent;
- myRefCon: LONGINT): OSErr;
- begin
- HandlePDOC := errAEEventNotHandled;
- end;
-
- function HandleODoc (theAppleEvent: AppleEvent;
- reply: AppleEvent;
- myRefCon: LONGINT): OSErr;
- begin
- HandleODoc := errAEEventNotHandled;
- end;
-
- function HandleQuit (theAppleEvent: AppleEvent;
- reply: AppleEvent;
- myRefCon: LONGINT): OSErr;
- var
- myErr: OSErr;
- begin
- myErr := RequiredCheck(theAppleEvent);
- if myErr = noErr then
- gDone := TRUE;
- HandleQuit := myErr;
- end;
- end.